package qsoft.omanga.ui.custom;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

import qsoft.omanga.ui.GalleryImagesMangaActivity;

import qsoft.omanga.ui.R;

/**
 * 
 * @author sontt
 * 
 */
public class DialogAdult extends Dialog implements
		android.view.View.OnClickListener {
	
	private Context context;
	/**
	 * 
	 */
	private Button btnYes, btnNo;

	/**
	 * 
	 * @param context
	 *            Context
	 */
	public DialogAdult(Context context) {
		super(context, android.R.style.Theme_Translucent_NoTitleBar);
		this.context = context;
		setContentView(R.layout.dialog_adult);
		btnYes = (Button) findViewById(R.id.btnAdultYes);
		btnYes.setOnClickListener(this);
		btnNo = (Button) findViewById(R.id.btnAdultNo);
		btnNo.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		if (v.equals(btnYes)) {
			Intent i = new Intent(context, GalleryImagesMangaActivity.class);
			context.startActivity(i);
			((Activity) context).finish();
			this.dismiss();
		} else if (v.equals(btnNo)) {
			this.dismiss();
		}
	}

}
